fenrisg_main() {
    hash pandoc &> /dev/null || {
        echo "ERROR: Could not find pandoc."
        exit 1
    }
    if (( $# == 0 )); then
        >&2 echo "Please choose a command:"
        get_usage
        exit 1
    fi
    if [[ "$1" == "help" ]] || \
           [[ "$1" == "--help" ]] || \
           [[ "$1" == "-h" ]]; then
        get_usage
        exit 0
    fi
    if [[ "$1" == "version" ]] || \
           [[ "$1" == "--version" ]] || \
           [[ "$1" == "-v" ]]; then
        local version=
        version=$(get_version)
        echo "fenrisg ${version}"
        exit 0
    fi
    if [[ "$1" == "rss" ]]; then
        shift
        build_rss_main "$@"
        exit 0
    fi
    if [[ "$1" == "sitemap" ]]; then
        shift
        build_sitemap_main "$@"
        exit 0
    fi

    build_site "$@"
}
